// 创建一个路由器，并暴露出去
import {createRouter,createWebHistory} from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: () => import('@/views/Layout.vue'),
      children: [ // 子路由
        {
          path: '/userManager',
          name: 'userManager',
          component: () => import('@/components/UserManager.vue')
        },
        {
          path: '/productManager',
          name: 'productManager',
          component: () => import('@/components/ProductManager.vue')
        },
        {
          path: '/fileManager',
          name: 'fileManager',
          component: () => import('@/components/FileManager.vue')
        }
      ]
    },{
        path: '/login',
        name: 'login',
        component: () => import('@/views/Login.vue')
    }
  ]
})

export default router